package com.iron.sfm.biz.controller;

import com.iron.common.core.util.R;
import com.iron.common.log.annotation.SysLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ProviderController
 *
 * @author YT
 * @date 2019-06-11
 */
@RestController
public class ProviderController {

    @Value("${server.port}")
    private String port;

    /**
     * 注入配置文件上下文对象
     */
    @Autowired
    private ConfigurableApplicationContext applicationContext;

    @GetMapping("/provider/test")
    public R providerTest() {
        return R.ok("hello nacos client");
    }

    @SysLog("测试操作日志注解")
    @GetMapping("/provider/log")
    public R logTest(){
        return R.ok("hello syslog");
    }
}
